﻿@{
    ViewBag.Title = "Home Page";
}

<div class="jumbotron">
    <div id="DIVINDIVVANJOS">
        <h1>Zuyd Kickstarter</h1>
        <p class="lead">Plaats hier je projecten zodat anderen kunnen doneren om het project te realiseren.</p>
        @{
            if (Session["Gebruiker"] == null)
            {
                <p>@Html.ActionLink("Registreer je vandaag!", "Create", "Gebruiker")</p>
            }
        }
    </div>
</div>

<div class="row">
    
        @{
            List<WebTV_Kickstarter.Project> projecten = ViewBag.Projecten;
            foreach (WebTV_Kickstarter.Project project in projecten)
            {
                <div class="col-md-4">
                <h2>@project.Title</h2>
                @Html.Raw(project.Description)
                <p><a class="btn btn-default" href="../project/details/@project.Id ">Lees meer &raquo;</a></p>
            
                @foreach (WebTV_Kickstarter.Goal goal in project.Goal)
	            {		            
                    <div class="meter">
                        <span style="width: @(((project.TotalAmount * 100 / goal.Amount) > 99) ? "100" : (project.TotalAmount * 100 / goal.Amount).ToString())%">@((project.TotalAmount * 100 / goal.Amount).ToString())%</span>
                    </div> 
                }
                </div>
            }
        }
</div>